package com.payment.service.impl;

import com.payment.entity.common.UserOrderPayment;
import com.payment.mapper.UserOrderPaymentMapper;
import com.payment.service.UserOrderPaymentService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Transactional
@Service
public class UserOrderPaymentServiceImpl implements UserOrderPaymentService {
    @Resource
    UserOrderPaymentMapper userOrderPaymentMapper;

    @Override
    public void updateWeiXinPayRst(UserOrderPayment payment) {
        userOrderPaymentMapper.updateWeiXinPayRst(payment);
    }

    @Override
    public void updateCallbackPayRst(UserOrderPayment payment) {
        userOrderPaymentMapper.updateCallbackPayRst(payment);
    }

    @Override
    public String queryPayRstByPayId(String out_trade_no) {
        return userOrderPaymentMapper.queryPayRstByPayId(out_trade_no);
    }

    @Override
    public int queryCountByPayId(String out_trade_no) {
        return userOrderPaymentMapper.queryCountByPayId(out_trade_no);
    }

    @Override
    public void dataTransfer() {
        userOrderPaymentMapper.dataTransfer();
    }

    @Override
    public void originalDataDelete() {
        userOrderPaymentMapper.originalDataDelete();
    }

    @Override
    public void updatePaymentForHist(UserOrderPayment payment) {
        userOrderPaymentMapper.updatePaymentForHist(payment);
    }

    @Override
    public Integer insertOrderToPaymentT(UserOrderPayment payment) {
        return userOrderPaymentMapper.insertOrderToPaymentT(payment);
    }
}
